package ModLayer;
import java.io.*;

/**
 * Write a description of class Company here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Company extends PersonInformations implements Serializable
{
    private static Company instance;
    private final String cvrNo = "DK-0318564";
    private final String glnNo = "1826490162784";
    private String faxNo;
    private String companyNo;
    private String fixedDiscount;
    
    public Company(String name, String email, String address, String phoneNo)
    {
        super(name, email, address, phoneNo);
        faxNo = "85217484";
        companyNo = "+71< 000003467233454+84639028<";//"84639028";
        fixedDiscount = "4";
    }
    
    public static Company getInstance()
    {
        if(instance == null)
        {
            instance = new Company("Vestbjerg Byggecenter A/S",
            "VestbjergByggecenter@dkk.dk",
            "Suderbovej 11-DK-9900 Frederikshavn", "93510564");
        }
        return instance;
    }
    
    public void setFaxNo(String faxNo)
    {
        this.faxNo = faxNo;
    }
    
    public void setCompanyNo(String companyNo)
    {
        this.companyNo = companyNo;
    }
    
    public boolean setFixedDiscount(String fixedDiscount)
    {
        boolean ok = false;
        int discountLocal = Integer.parseInt(fixedDiscount.substring(0));
        if(discountLocal<=25)
        {
            this.fixedDiscount = fixedDiscount;
            ok = true;
        }
        return ok;
    }
    
    public String getFaxNo()
    {
        return faxNo;
    }
    
    public String getCompanyNo()
    {
        return companyNo;
    }
    
    //public String getCompanyNoBank()
    //{
    //    return ("-"+companyNo+"<");
    //}
    
    public String getfixedDiscount()
    {
        return fixedDiscount;
    }
    
    public String toString()
    {
        return "Company";
    }
}